#ifndef PLAYLISTWIDGET_H
#define PLAYLISTWIDGET_H

#include <QObject>
#include <QMetaObject>
#include <QTableWidget>
#include <QHeaderView>
#include <QPushButton>

#include "Playlist.h"
#include "PlaylistVoteWidget.h"
#include "../Client/PlaylistClient.h"
#include "Observer.h"

/*-------------------------------------------------------------------------------------
--
--	CLASS: PlaylistWidget
--
--	Date: April 1, 2010
--
--	REVISIONS (Date and Description):
--
--	DESIGNER: Erick Ribeiro
--
--	PROGRAMMER: Erick Ribeiro
--
--  INTERFACE: class PlaylistWidget : public QTableWidget, public Observer
--
--  RETURNS: N/A
--
--	NOTES: Handles the adding/removing of songs and populates the list. Also
--         responsible of notifying the clients when the list changes.
--
-------------------------------------------------------------------------------------*/
class PlaylistWidget : public QTableWidget, public Observer
{
Q_OBJECT

public:
    PlaylistWidget (Playlist * thePlaylist, PlaylistClient * client = 0);
    void notify (Observable * obj, int eventCode);

protected slots:
    void songAdded ();
    void songRemoved ();
    void votesChanged ();
    void nowPlayingChanged ();

private:
    Playlist       * playlist;
    PlaylistClient * playlistClient;
};

#endif
